// JavaScript Document
window.onload = function(){
			var otxt = document.getElementById("txt");
			var oul = document.getElementById("ul");
			otxt.onkeyup = function(){
				var sc = document.createElement("script");
				sc.src = "https://sp0.baidu.com/5a1Fazu8AA54nxGko9WTAnF6hhy/su?wd=" + otxt.value + "&cb=fn"
				document.getElementsByTagName("head")[0].appendChild(sc);
				oul.style.display = "block";
			 
			}
			var oli = document.getElementById("li");
			var osub = document.getElementsByClassName("sub")[0];
			var oli1 = document.getElementById("li1");
			var olod = document.getElementsByClassName("loding")[0];
			var oli2 = document.getElementById("li2");
			var osub1 = document.getElementsByClassName("sub1")[0];
			oli.onmouseover = osub.onmouseover = function(evt){
					var e = evt || window.event;
					osub.style.display = "block";
				}
			oli.onmouseout = osub.onmouseout = function(evt){
					var e = evt || window.event;
					osub.style.display = "none";
				}
			oli2.onmouseover = osub1.onmouseover = function(evt){
					var e = evt || window.event;
					osub1.style.display = "block";
				}
			oli2.onmouseout = osub1.onmouseout = function(evt){
					var e = evt || window.event;
					osub1.style.display = "none";
				}
			oli1.onclick = function(evt){
					var e = evt || window.event;
					olod.style.display = "block";
				}
		}
			
		
		
		function fn(str){
			// console.log(str);
			   var oul = document.getElementById("ul");
			   var otxt = document.getElementById("txt");
				oul.innerHTML = "";
				for(var i = 0;i < str.s.length;i ++){
						var oli = document.createElement("li");
						oli.innerHTML += str.s[i];
						oul.appendChild(oli);
						oli.onmouseover = function(evt){
						var e = evt || window.event;
						this.style.background = "#f0f0f0";
					}
				oli.onmouseout = function(evt){
					var e = evt || window.event;
					this.style.background = "#fff";
					}
				oli.onclick = function(evt){
					var e = evt || window.event;
					otxt.value = this.innerHTML;
					oul.style.display = "none";
					}
				
				}
		}